<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>权限</title>
</head>
<body>
<div class="layui-fluid">
    <a class="layui-btn layui-btn-normal" style="margin-left: 90%;" name="addRoot">添加新权限</a>
</div>
<div class="layui-fluid">
    <fieldset class="layui-elem-field layui-field-title" style="margin-top: 30px;">
        <legend>权限展示</legend>
    </fieldset>
    <form class="layui-form" action="">
    <#if roots?? && (roots?size > 0)>
        <div class="layui-form-item">
            <div class="layui-input-block">
                <div class="layui-btn-container">
                    <#list roots as root>
                        <a class="layui-btn rootInfo" id="${root.id}" rootName="${root.root}" style="margin-bottom: 10px;">${root.descript}</a>
                    </#list>
                </div>
            </div>
        </div>
    <#else>
        <fieldset class="layui-elem-field layui-field-title" style="margin-top: 30px;">
            <legend>暂无权限</legend>
        </fieldset>
    </#if>
    </form>
</div>

<div id="addRootInfo" class="layui-fluid" hidden style="margin-top: 5%;">
    <fieldset class="layui-elem-field layui-field-title" style="margin-top: 30px;">
        <legend id="fieldTitle">请输入新权限</legend>
    </fieldset>
    <form class="layui-form" action="">
        <div class="layui-fluid">
            <div class="layui-form-item">
                <label class="layui-form-label">权限</label>
                <div class="layui-input-block" style="margin-right: 5%">
                    <input type="text" id="rootName" required  lay-verify="required" lay-verify="title" placeholder="请输入英文权限名" autocomplete="off"  class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">描述</label>
                <div class="layui-input-block" style="margin-right: 5%">
                    <input type="text" id="rootDesc" required  lay-verify="required" lay-verify="title" placeholder="请输入准确描述" autocomplete="off"  class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <div class="layui-input-block">
                    <a class="layui-btn cbtn" id="confirmAddRoot">确认添加</a>
                    <a id="resetRoot" class="layui-btn layui-btn-primary">重置</a>
                </div>
            </div>
        </div>
    </form>
</div>
</body>
</html>